from hec.script import *
from hec.heclib.dss import *
from hec.heclib.util import *
from hec.io import *
import java
import Tools

outFile = HecDss.open("D:/cvwrsm/trunk/dsshec/dsstest/dss/ShiftedSV.dss")
pathDict = {}

futureStart = HecTime("01OCT2010", "0000")
histStart = "01OCT1996 0000"
histEnd   = "01OCT1997 0000"

precip = TimeSeriesContainer()

#outData = DataContainer()
inFile = HecDss.open("D:/cvwrsm/trunk/dsshec/dsstest/dss/OriginalSV.dss", "01OCT1986 0000, 01OCT1987 0000")
# pathList = inFile.getCatalogedPathnames()
pathList = inFile.getPathnameList()
pathDict = Tools.getCleanPath(pathList)


for k, v in sorted(pathDict.items()):

    v = pathDict[k]
    inData = inFile.get(k)
    newPathName = Tools.gluePathname(v["A"],v["B"],v["C"],"1MON","future")
#    print "newName: "+newPathName
    tsc = TimeSeriesContainer()
    
    tsc.interval = 1

    tsc.times = inData.times
    tsc.values = inData.values
    tsc.numberValues = len(inData.values)
    tsc.units = "CFS"
    tsc.type = "PER-AVER"
    tsc.fullName = newPathName

#    print "tsc: "+tsc.fullName
    outFile.put(tsc)
outFile.close()

    

